﻿@{
    
}
@section head{
    <title>黄页管理</title>
}
@section content{
    <div id="pageflag" data-nav="page" data-ban="page"></div>
    <div class="container">
        <ol class="breadcrumb">
            <li><a title="会员中心" href="@Url.Action("Default","")">会员中心</a></li>
            <li class="active">企业黄页</li>
            <div class="clearfix"></div>
        </ol>
        <div style="width: 100%">
            <div style="width: 25%; float: left">
                <iframe style="height:400px;width:100%;border:none;" src="@Url.Action("NodeTree","Pages")" id="main_left" name="main_left"></iframe>
            </div>
            <div style="width: 75%; float: left">
                @*原ondatabinding()事件改为onload时间，不知是否可以*@
                <iframe style="width:100%; height:500px;" onload="dynSizeByParent()" src="MyContent" frameborder="0" name="main_right1" id="main_right1"></iframe>
            </div>
        </div>
    </div>
}
@section script{
    <script>
        var iframeids = ["main_right1"];
        function dynSizeByContent() {//滚动条在父窗口
            for (i = 0; i < iframeids.length; i++) {
                var dyniframe = document.getElementById(iframeids[i]);
                if (dyniframe && !window.opera) {
                    dyniframe.style.display = "block";
                    if (dyniframe.contentDocument && dyniframe.contentDocument.body.offsetHeight) {
                        alert("1");
                        dyniframe.style.height = (dyniframe.contentDocument.body.offsetHeight + 5) + "px";
                    }
                    else if (dyniframe.Document && dyniframe.Document.body) {
                        alert("2");
                        if (dyniframe.Document.body.scrollHeight) {
                            dyniframe.style.height = dyniframe.Document.body.scrollHeight + 5;
                        }
                    }
                }
            }//for end;
        }
        window.onload = dynSizeByParent;
        function dynSizeByParent()//滚动条在框架内
        {
            for (i = 0; i < iframeids.length; i++) {
                var dyniframe = document.getElementById(iframeids[i]);
                if (dyniframe && !window.opera) {
                    dyniframe.style.display = "block";
                    if (dyniframe.contentDocument && dyniframe.contentDocument.body.offsetHeight) {
                        dyniframe.height = document.documentElement.clientHeight - 140;
                    }
                    else if (dyniframe.Document && dyniframe.Document.body) {
                        dyniframe.height = document.documentElement.clientHeight - 140;
                    }
                }
            }
        }
    </script>
}
